<template>
  <a-drawer
    width="576"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="12">
            <a-form-model-item label="${comment}" prop="ind">
              <a-input-number v-model="form.ind" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="${comment}" prop="inddoc">
              <a-input-number v-model="form.inddoc" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="姓名" prop="name">
              <a-input v-model="form.name" placeholder="请输入姓名"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="第一人名" prop="firstname">
              <a-input v-model="form.firstname" placeholder="请输入第一人名"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="第二人名" prop="patname">
              <a-input v-model="form.patname" placeholder="请输入第二人名"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="地址" prop="address">
              <a-input v-model="form.address" placeholder="请输入地址"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="性别" prop="pol">
              <a-input v-model="form.pol" placeholder="请输入性别"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="电话" prop="phone">
              <a-input v-model="form.phone" placeholder="请输入电话"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="年龄" prop="comment">
              <a-input v-model="form.comment" placeholder="请输入年龄"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="${comment}" prop="age">
              <a-input-number v-model="form.age" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="${comment}" prop="birthdate">
              <a-date-picker
                v-model="form.birthdate"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="性别" prop="sex">
              <a-radio-group v-model="form.sex">
                <a-radio
                  v-for="(dict, index) in sexOptions"
                  :key="index"
                  :value="dict.dictValue"
                >
                  {{ dict.dictLabel }}
                </a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="${comment}" prop="clientid">
              <a-input-number v-model="form.clientid" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="最后登录IP" prop="loginIp">
              <a-input v-model="form.loginIp" placeholder="请输入最后登录IP"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="最后登录时间" prop="loginDate">
              <a-date-picker
                v-model="form.loginDate"
                valueFormat="YYYY-MM-DD"
                :show-today="true"
                placeholder="选择日期"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
            保存
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import PacientEditForm from './PacientForm'
export default {
  ...PacientEditForm
}
</script>
